package com.example.dell.adapter;

import android.graphics.Color;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.dell.basicapplication.R;
import com.example.dell.been.VidoSelectBeen;

import java.util.List;

public class VideoItemsSelectAdapter extends BaseQuickAdapter<VidoSelectBeen,BaseViewHolder> {

    private int mType;
    public VideoItemsSelectAdapter(int layoutResId, @Nullable List<VidoSelectBeen> data, int type) {
        super(layoutResId, data);
        this.mType = type;
    }

    @Override
    protected void convert(BaseViewHolder helper, VidoSelectBeen item) {

        TextView view = (TextView)helper.getView(R.id.name);
        if (item.getType()==mType) {
            view.setText(item.getName());
            view.setTextColor(Color.parseColor("#008577"));
        }else {
            view.setText(item.getName());
            view.setTextColor(Color.parseColor("#00574B"));
        }
    }
}
